<?php defined('IN_ADMIN') or exit('Access Denied!'); ?>
<div class="subnav">
  <div class="content-menu ib-a blue line-x">
    <a href='javascript:;' class="on"><em>相册管理</em></a> <span>|</span>
    <a href="/admin/album_cat/list/<?=$shop_id;?>"><em>相册分类</em></a> <span>|</span>
    <a href="#" onclick="show_dialog('add', '/admin/album/import/<?=$shop_id;?>?album_cat=<?=$album_cat;?>', '批量添加新图片')"><em>批量添加新图片</em></a>
  </div>
</div>
<form name="myform" action="/admin/album/sortlist/<?=$shop_id;?>" method="post">
  <div class="pad_10">
    <div class="table-list">
      <table width="100%" cellspacing="0">
        <thead>
          <tr>
            <th width="38">排序</th>
            <th width="30">Id</th>
            <th width="60">图片</th>
            <th>标题</th>
            <th width="80">字节</th>
            <th width="150">上传时间</th>
            <th width="200">管理操作</th>
          </tr>
        </thead>
        <tbody>
        <?php
        if(is_array($list) && count($list)){
          foreach($list as $item){
        ?>
          <tr>
            <td align="center"><input name="sorts[<?=$item['album_id'];?>]" type="text" size="3" value="<?=$item['ordnum'];?>" class="input-text-c"></td>
            <td align="center"><?=$item['album_id'];?></td>
            <td align="center"><img src="<?=thumb_url($item['picture'], 100, 100);?>" height="50" /></td>
            <td><?=h($item['name']);?></td>
            <td align="center"><?=convert_size(i($item['size']));?></td>
            <td align="center"><?=h($item['create_dt']);?></td>
            <td align="center">
                <a href="#" onclick="preview(<?=$item['album_id'];?>, '<?=h($item['name']);?>', '<?=UPLOAD_URL.h($item['picture']);?>');">预览</a>
                  <span>|</span>
                <a href="#" onclick="show_dialog('edit', '/admin/album/modify/<?=$item['shop_id'];?>-<?=$item['album_id'];?>', '编辑图片');">编辑</a>
                  <span>|</span>
                <a href="/admin/album/delete/<?=$item['shop_id'];?>?album_id=<?=$item['album_id'];?>" onclick="return confirm('确定要删除该图片？')">删除</a>
            </td>
          </tr>
        <?php
            }
          }else{
        ?>
            <tr><td colspan="7" height="50" align="center">暂无数据</td></tr>
        <?php } ?>
         </tbody>
      </table>
      <?php if(is_array($list) && count($list)){ ?>
      <div class="btn">
        <input type="submit" class="button" name="dosubmit" value="排序" />
      </div>
      <?php } ?>
    </div>
  </div>
</form>
<script>
function preview(id, name,imgurl) {
    var width = 500;
    var height = 400;
    window.top.art.dialog({width: width, height: height, title:'预览',fixed:true, content:'<img src="' +imgurl+ '" width="' +width+ '" height="' +height+ '" />'});
}
</script>